package org.example.service.impl;

import org.example.dao.OrderDao;
import org.example.service.TestService;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

public class TestServiceImpl implements TestService, InitializingBean, DisposableBean {

    //配合构造器注入，创建带参数的构造函数
    private OrderDao orderDao;
    private String daoName;

    public TestServiceImpl (OrderDao orderDao,String daoName){
        this.daoName=daoName;
        this.orderDao=orderDao;
    }
    @Override
    public void get() {
        System.out.println("TestService...."+orderDao+"  "+daoName);
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("TestService destroy .....");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("TestService init......");
    }
}
